package com.gumanx;

import java.util.Random;



import net.minecraft.block.Block;
import net.minecraft.block.BlockTNT;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.util.Icon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;

public class BlockBombAtomic extends BlockTNT {

	private Icon Atomic_top;
	private Icon Atomic_bottom;

	public BlockBombAtomic(int par1) {
		super(par1);
		this.setCreativeTab(CreativeTabs.tabRedstone);

	}

	public void func_94391_a(World par1World, int par2, int par3, int par4,
			int par5, EntityLiving par6EntityLiving) {
		if (!par1World.isRemote) {
			if ((par5 & 1) == 1) {
				EntityBombAtomic entitytntprimed = new EntityBombAtomic(
						par1World, (double) ((float) par2 + 0.5F),
						(double) ((float) par3 + 0.5F),
						(double) ((float) par4 + 0.5F), par6EntityLiving);
				par1World.spawnEntityInWorld(entitytntprimed);
				par1World.playSoundAtEntity(entitytntprimed, "random.fuse",
						1.0F, 1.0F);
			}
		}
	}

	public int idDropped(int par1, Random par2Random, int par3) {
		return _GumanxModBase.BlockBombAtomic.blockID;
	}
	
	/**
	 * Assigns the icons to their respective sides
	 */
	public Icon getIcon(int par1, int par2)
    {
        return par1 == 1 ? this.Atomic_top : (par1 == 0 ? this.Atomic_bottom : this.blockIcon);
    }

	public void registerIcons(IconRegister iconReg) {
		blockIcon = iconReg.registerIcon("gumanx:bombAtomic");
		Atomic_top = iconReg.registerIcon("gumanx:bombAtomic");
		Atomic_bottom = iconReg.registerIcon("gumanx:bombAtomic");
	}

}
